﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ConsoleApp3
{
    class student
    {
        public int Stunum { get; set; }
        public string Name { get; set; }
        public char Sex { get; set; }
        private int age;
        public string Studyinfo { get; set; }
        public int Age 
        {
            get { return this.age; }
            set {
                if (value < 0 || value > 128)
                {
                    value = 0;
                }
                this.age = value ;  }
        
        }

        public student()
        {
        }
        public student(int Stunum, string Name, char Sex, int Age, string Studyinfo)
        {
            this.Stunum = Stunum;
            this.Name = Name;
            this.Sex = Sex;
            this.Age = Age;
            this.Studyinfo = Studyinfo;
        }
        public void print()
        {
            Console.WriteLine("学号{0}，姓名{1}，性别{2}，年纪{3}，专业信息{4}",this.Stunum,this.Name,this.Sex,this.Age,this.Studyinfo);
        }
    }
}
